{% extends 'TopxiaWebBundle:MyCourse:layout.html.twig' %}

{% block title %}{{'已收藏'|trans}} - {{ parent() }}{% endblock %}

{% set tab_nav = 'favorited' %}

{% block main %}
<style>
.course-grids .metas{
  position: relative;
  color: #c1c1c1;
  padding:10px;
  text-align:left;
}

.course-grids .course-price-widget{
	float:right;
}
</style>
	<div class="panel panel-default panel-col">
	  <div class="panel-heading">{{'我的课程'|trans}}</span></div>
  	<div class="panel-body">
  		{% include 'TopxiaWebBundle:MyCourse:nav-pill.html.twig' %}

			<ul class="course-grids">
			  {% for courseFavorite in courseFavorites if courseFavorite %}
					
					{% set mode = 'default' %}
					{% if courseFavorite.type == 'course' %}
	          {% set course = data('Course',{courseId:courseFavorite.courseId}) %}
	          {% include 'TopxiaWebBundle:Course:Widget/my-course-grid.html.twig' %}
	        {% elseif courseFavorite.type == 'openCourse' %}
	          {% set course = data('OpenCourse',{courseId:courseFavorite.courseId})|default(null) %}
						{% if course %}
							{% include 'TopxiaWebBundle:OpenCourse/Widget:my-open-course-grid.html.twig' %}
						{% endif %}
	          
	        {% endif %}
			  {% else %}
			    <div class="empty">{{'暂无已收藏的课程'|trans}}</div>
			  {% endfor %}
			</ul>
		</div>

		<nav class="text-center">
	    {{ web_macro.paginator(paginator) }}
	  </nav>
	</div>
{% endblock %}